package com.yilin.tms.core.entity.capital;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yilin.tms.core.commons.base.BaseDataEntity;
import com.yilin.tms.core.commons.annotation.Explain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

@Entity
@Table(name = "capital_trade_flow")
@TableName(value = "capital_trade_flow")
public class TradeFlow extends BaseDataEntity {
    //是否以通知
    public enum PaymentType {
        expenditure(0, "支出"),
        income(1, "收入"),
        frozen(2, "冻结"),
        thaw(3, "解冻");
        @EnumValue
        public Integer index;
        public String name;

        PaymentType(Integer index, String name) {
            this.index = index;
            this.name = name;
        }
    }
    public enum Upper {
        yes(0, "上送对账"),
        no(1, "不上送对账");
        @EnumValue
        public Integer index;
        public String name;

        Upper(Integer index, String name) {
            this.index = index;
            this.name = name;
        }
    }

    @Column(name = "trans_name")
    private String transName;//交易名称
    @Column(name = "trade_no")
    private String tradeNo;//本地流水号
    @Column(name = "bank_flow_no")
    private String bankFlowNo;//第三方流水号
    @Column(name = " pay_type")
    private TradeRecord.PayType payType;//支付方式
    @Column(name = " money")
    private Double money;//交易金额
    @Column(name = " payment_type")
    private PaymentType paymentType;//收支类型
    @Column(name = " upper")
    private Upper upper;//收支类型
    @Column(name = "trades_date")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date tradesDate;//交易日期
    /**
     * 组织信息
     */
    @Column(name = "organize_id")
    private String organizeId;//组织ID
    @Column(name = "organize_name")
    private String organizeName;//组织名称
    @Column(name = "capital_account")
    @Explain("号")
    private String capitalAccountNo;//资金结算户账号/卡号/微信ID/支付宝ID 等

    public String getTransName() {
        return transName;
    }

    public void setTransName(String transName) {
        this.transName = transName;
    }

    public String getTradeNo() {
        return tradeNo;
    }

    public void setTradeNo(String tradeNo) {
        this.tradeNo = tradeNo;
    }

    public String getBankFlowNo() {
        return bankFlowNo;
    }

    public void setBankFlowNo(String bankFlowNo) {
        this.bankFlowNo = bankFlowNo;
    }

    public TradeRecord.PayType getPayType() {
        return payType;
    }

    public void setPayType(TradeRecord.PayType payType) {
        this.payType = payType;
    }

    public Double getMoney() {
        return money;
    }

    public void setMoney(Double money) {
        this.money = money;
    }

    public PaymentType getPaymentType() {
        return paymentType;
    }

    public void setPaymentType(PaymentType paymentType) {
        this.paymentType = paymentType;
    }

    public Upper getUpper() {
        return upper;
    }

    public void setUpper(Upper upper) {
        this.upper = upper;
    }

    public Date getTradesDate() {
        return tradesDate;
    }

    public void setTradesDate(Date tradesDate) {
        this.tradesDate = tradesDate;
    }

    public String getOrganizeId() {
        return organizeId;
    }

    public void setOrganizeId(String organizeId) {
        this.organizeId = organizeId;
    }

    public String getOrganizeName() {
        return organizeName;
    }

    public void setOrganizeName(String organizeName) {
        this.organizeName = organizeName;
    }

    public String getCapitalAccountNo() {
        return capitalAccountNo;
    }

    public void setCapitalAccountNo(String capitalAccountNo) {
        this.capitalAccountNo = capitalAccountNo;
    }
}
